//
//  IAATabBarVC.m
//  iPadAuditAuthorise
//
//  Created by XiangDongMBP on 16/9/2.
//  Copyright © 2016年 XiangDong. All rights reserved.
//

#import "IAATabBarVC.h"
#import "IAAInfoMsgVC.h"
#import "IAAHisTaskVC.h"
#import "IAAAuthCheckVC.h"
#import "IAASettingVC.h"
#import "IAARTMsgQuery.h"
#import "IAAModifyPwdVC.h"

@interface IAATabBarVC ()

@property (strong, nonatomic) IAARTMsgQuery *msgQuery;

@end

@implementation IAATabBarVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    IAAAuthCheckVC *authVC = [[IAAAuthCheckVC alloc] init];
    UINavigationController *navAuthVC = [[UINavigationController alloc] initWithRootViewController:authVC];
    navAuthVC.tabBarItem.title = @"业务审核";
    navAuthVC.tabBarItem.image = [UIImage imageNamed:@"tab_authChe_nor"];
    navAuthVC.tabBarItem.selectedImage = [UIImage imageNamed:@"tab_authChe_sel"];
    
    IAAInfoMsgVC * infoVC = [[IAAInfoMsgVC alloc] init];
    UINavigationController *navInfoVC = [[UINavigationController alloc] initWithRootViewController:infoVC];
    navInfoVC.tabBarItem.title = @"历史信息通知";
    navInfoVC.tabBarItem.image = [UIImage imageNamed:@"tab_infoMsg_nor"];
    navInfoVC.tabBarItem.selectedImage = [UIImage imageNamed:@"tab_infoMsg_sel"];
    
    IAAHisTaskVC * hisVC = [[IAAHisTaskVC alloc] init];
    UINavigationController *navHisVC = [[UINavigationController alloc] initWithRootViewController:hisVC];
    navHisVC.tabBarItem.title = @"历史审核任务查看";
    navHisVC.tabBarItem.image = [UIImage imageNamed:@"tab_hisTask_nor"];
    navHisVC.tabBarItem.selectedImage = [UIImage imageNamed:@"tab_hisTask_sel"];
    
    IAASettingVC *setVC = [[IAASettingVC alloc] init];
    UINavigationController *navSetVC = [[UINavigationController alloc] initWithRootViewController:setVC];
    navSetVC.tabBarItem.title = @"设置";
    navSetVC.tabBarItem.image = [UIImage imageNamed:@"tab_setting_nor"];
    navSetVC.tabBarItem.selectedImage = [UIImage imageNamed:@"tab_setting_sel"];
    
    self.viewControllers = @[navAuthVC, navInfoVC, navHisVC, navSetVC];
    
    if (IAA_APP_DELEGATE.jumpToModifyPwd) {
        IAA_APP_DELEGATE.jumpToModifyPwd = NO;
        [self setSelectedIndex:3];
        IAAModifyPwdVC *vc = [[IAAModifyPwdVC alloc] init];
        [navSetVC pushViewController:vc animated:YES];
    }
    
    // 开启定时请求
    self.msgQuery = [IAARTMsgQuery sharedInstance];
//    [self.msgQuery startQuery];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
